package org.haredot.vo;

import com.github.pagehelper.IPage;

import java.util.List;
import java.util.Map;

public class PageVo<T> implements IPage {
    /**
     * 页码
     */
    private transient Integer page ;
    /**
     * 每页显示条数
     */
    private transient Integer limit ;
    /**
     * 总条数
     */
    private long total ;
    /**
     * 当前页显示的数据
     */
    private List<T> list ;
    /**
     * 查询参数
     */
    private Map<String, ?> params ;

    public PageVo(Integer page, Integer limit) {
        this.page = page;
        this.limit = limit;
    }

    public Map<String, ?> getParams() {
        return params;
    }

    public void setParams(Map<String, ?> params) {
        this.params = params;
    }

    @Override
    public Integer getPageNum() {
        return this.page;
    }

    @Override
    public Integer getPageSize() {
        return this.limit;
    }


    @Override
    public String getOrderBy() {
        return null;
    }

    public long getTotal() {
        return total;
    }

    public PageVo<T> setTotal(long total) {
        this.total = total;
        return this ;
    }

    public List<T> getList() {
        return list;
    }

    public PageVo<T> setList(List<T> list) {
        this.list = list;
        return this ;
    }
}
